import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule }   from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';


import { AppComponent } from './app.component';
import {homeComponent} from './components/home.component';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { IndexComponent } from './index/index.component';
import { MachineRoomComponent } from './machine-room/machine-room.component';

const appRoutes: Routes = [
  {
    path: 'home/:id',
    component: homeComponent
  },
  {
    path: 'machineroom/:id',
    component: MachineRoomComponent
  },
  {
    path: 'index',
    component: IndexComponent
  },
  { path: '', redirectTo: '/index', pathMatch: 'full' },
]

@NgModule({
  declarations: [
    AppComponent,
    homeComponent,
    IndexComponent,
    MachineRoomComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    BrowserAnimationsModule,
    NgZorroAntdModule.forRoot(),
    RouterModule.forRoot(
      appRoutes,
      { enableTracing: true } // <-- debugging purposes only
    )
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
